package cnsukidayo.com.gitee.model.contract;

import org.fisco.bcos.sdk.abi.wrapper.ABIObject;

import java.util.List;

/**
 * @author sukidayo
 * @date 2023/4/8 15:53
 */
public class PetContract {
    private String name;
    private long birthTime;
    private String birthPlace;
    private long deathTime;
    private String fatherAddress;
    private String motherAddress;
    private String lineage;

    public PetContract() {
    }

    public static PetContract newInstance(ABIObject abiObject) {
        List<ABIObject> listValues = abiObject.getListValues();
        PetContract petContract = new PetContract();
        petContract.setName(listValues.get(0).getStringValue().getValue());
        petContract.setBirthTime(listValues.get(1).getNumericValue().getValue().intValue());
        petContract.setBirthPlace(listValues.get(2).getStringValue().getValue());
        petContract.setDeathTime(listValues.get(3).getNumericValue().getValue().intValue());
        petContract.setFatherAddress(listValues.get(4).getAddressValue().getValue());
        petContract.setMotherAddress(listValues.get(5).getAddressValue().getValue());
        petContract.setLineage(listValues.get(6).getStringValue().getValue());
        return petContract;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getBirthTime() {
        return birthTime;
    }

    public void setBirthTime(long birthTime) {
        this.birthTime = birthTime;
    }

    public String getBirthPlace() {
        return birthPlace;
    }

    public void setBirthPlace(String birthPlace) {
        this.birthPlace = birthPlace;
    }

    public long getDeathTime() {
        return deathTime;
    }

    public void setDeathTime(long deathTime) {
        this.deathTime = deathTime;
    }

    public String getFatherAddress() {
        return fatherAddress;
    }

    public void setFatherAddress(String fatherAddress) {
        this.fatherAddress = fatherAddress;
    }

    public String getMotherAddress() {
        return motherAddress;
    }

    public void setMotherAddress(String motherAddress) {
        this.motherAddress = motherAddress;
    }

    public String getLineage() {
        return lineage;
    }

    public void setLineage(String lineage) {
        this.lineage = lineage;
    }
}
